﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Quartz.Net.Model;
using System.Data.OracleClient;
using System.Data;

namespace Quartz.Net.DAL
{
    /// <summary>
    /// 程序运行历史表
    /// </summary>
   public class Task_Quartz_OldrunDAL
    {
       public int InsertOldRun(Task_Quartz_OldRunModel model)
       {
           string strSql = @"insert into TASK_QUARTZ_OLDRUN (NGUID,JOBGUID,LASTTIME,NEXTTIME,JOBRUNTIME,INSERTTIME,INSERTDATE,VALID)
                            values (:NGUID,:JOBGUID,:LASTTIME,:NEXTTIME,:JOBRUNTIME,:INSERTTIME,:INSERTDATE,:VALID)";

           OracleParameter[] para = {
                                         new OracleParameter(":NGUID",OracleType.VarChar,200),
                                         new OracleParameter(":JOBGUID",OracleType.VarChar,200),
                                         new OracleParameter(":LASTTIME",OracleType.DateTime),
                                         new OracleParameter(":NEXTTIME",OracleType.DateTime),
                                         new OracleParameter(":JOBRUNTIME",OracleType.VarChar,200),
                                         new OracleParameter(":INSERTTIME",OracleType.Timestamp),
                                         new OracleParameter(":INSERTDATE",OracleType.DateTime),
                                         new OracleParameter(":VALID",OracleType.Char,1)
                                     };
           para[0].Value = model.NGUID;
           para[1].Value = model.JOBGUID;
           para[2].Value = model.LASTTIME;
           para[3].Value = model.NEXTTIME;
           para[4].Value = model.JOBRUNTIME;
           para[5].Value = model.INSERTTIME;
           para[6].Value = model.INSERTDATE;
           para[7].Value = model.VALID;

           return DalBase.ExecuteNonQuery(strSql, para);

       }
    }
}
